Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Commit d6ec05193b3b79ab577ca2a4173ef3ef51492db8


Parents : 7f0e262
Author : Mark Qvist <bc7291552be7a58f361522990465165c>
Date : 2026-05-20T19:52:55+02:00

Ensure different tmp-file names if os.getpid() is not available

Changes

1 files changed, 1 insertions(+), 1 deletions(-)


Diff

diff --git a/LXMF/LXMessage.py b/LXMF/LXMessage.py
index 5271d4e..639ab36 100644
--- a/LXMF/LXMessage.py
+++ b/LXMF/LXMessage.py
@@ -672,7 +672,7 @@ class LXMessage:
def write_to_directory(self, directory_path):
file_name = RNS.hexrep(self.hash, delimit=False)
file_path = directory_path+"/"+file_name
- tmp_path = file_path+".tmp."+str(os.getpid())
+ tmp_path = file_path+".tmp."+str(os.getpid() or time.time())
try:
with open(tmp_path, "wb") as file:


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────